package com.ltc.service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ObjectUtils;

@Configuration
@ComponentScan("com.ltc.service")
public class MainStat {
	public static void main(String[] args) {
//		springStart();
		usualStart();
	}

	/**
	 * spring启动
	 */
	private static void springStart() {
		ApplicationContext context = new AnnotationConfigApplicationContext(MainStat.class);
		UserServiceImpl bean = context.getBean(UserServiceImpl.class);
		bean.test();
	}

	/**
	 * 平常启动
	 */
	private static void usualStart() {
		UserServiceImpl u1 = null;
		UserServiceImpl u2 = new UserServiceImpl();
		boolean b = ObjectUtils.nullSafeEquals(u1, u2);
		System.out.println(b);
	}
}
